package org.wu.framework.lazy.orm.core.config.ddl;

import org.wu.framework.lazy.orm.core.config.enums.DDLAuto;
import org.wu.framework.lazy.orm.core.config.prop.SchemaScript;
import org.wu.framework.lazy.orm.core.persistence.conf.mysql.FieldLazyTableFieldEndpoint;

import java.util.List;

/**
 * DDL 配置
 */
public interface LazyDdlConfigureAttribute {

    /**
     * DDL  操作
     */
    DDLAuto getDdlAuto();

    /**
     * DDL  操作
     */
    void setDdlAuto(DDLAuto ddlAuto);

    /**
     * DDL 完善表承诺书
     * 此操作会删除字段完全按照模型完善表⚠️
     */
    String getDdlPerfectCommitment();

    /**
     * DDL 完善表承诺书
     * 此操作会删除字段完全按照模型完善表⚠️
     */
    void setDdlPerfectCommitment(String ddlPerfectCommitment);

    /**
     * DDL 忽略字段
     */
    List<String> getDdlIgnoredFields();

    /**
     * DDL 忽略字段
     */
    void setDdlIgnoredFields(List<String> ddlIgnoredFields);

    /**
     * DDL 忽略表前缀
     */
    List<String> getDdlIgnoredTablePrefix();

    /**
     * DDL 忽略表前缀
     */
    void setDdlIgnoredTablePrefix(List<String> ddlIgnoredTablePrefix);

    /**
     * DDL 忽略表后缀 天然适应Uo
     */
    List<String> getDdlIgnoredTableSuffix();

    /**
     * DDL 忽略表后缀 天然适应Uo
     */
    void setDdlIgnoredTableSuffix(List<String> ddlIgnoredTableSuffix);

    /**
     * 是否开启额外字段
     */
    Boolean getEnableExtraFields();

    /**
     * 是否开启额外字段
     */
    void setEnableExtraFields(Boolean enableExtraFields);

    /**
     * 额外的字段 当 enableExtraFields=true 时有效
     * <p>
     * "`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',\n" +
     * "`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',\n" +
     * "`create_time` datetime DEFAULT CURRENT_TIMESTAMP  COMMENT '创建时间',\n" +
     * "`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',\n" +
     * "PRIMARY KEY (`id`) USING BTREE\n";
     *
     * <p>
     * spring:
     * lazy:
     * ddl-configure:
     * ddl-ignored-table-suffix:
     * - DO
     * ddl-auto: perfect
     * extra-fields:
     * - name: isDelete
     * columnName: is_delete
     * columnType: tinyint(1)
     * comment: 是否删除
     * defaultValue: '0'
     * exist: true
     * </p>
     */
    List<FieldLazyTableFieldEndpoint> getExtraFields();

    /**
     * 额外的字段 当 enableExtraFields=true 时有效
     * <p>
     * "`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',\n" +
     * "`is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除',\n" +
     * "`create_time` datetime DEFAULT CURRENT_TIMESTAMP  COMMENT '创建时间',\n" +
     * "`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',\n" +
     * "PRIMARY KEY (`id`) USING BTREE\n";
     *
     * <p>
     * spring:
     * lazy:
     * ddl-configure:
     * ddl-ignored-table-suffix:
     * - DO
     * ddl-auto: perfect
     * extra-fields:
     * - name: isDelete
     * columnName: is_delete
     * columnType: tinyint(1)
     * comment: 是否删除
     * defaultValue: '0'
     * exist: true
     * </p>
     */
    void setExtraFields(List<FieldLazyTableFieldEndpoint> extraFields);

    /**
     * 初始化脚本
     */
    SchemaScript getSchemaScript();

    /**
     * 初始化脚本
     */
    void setSchemaScript(SchemaScript schemaScript);

    /**
     * 导出表结构
     */
    boolean isOutPutTableStructure();

    /**
     * 导出表结构
     */
    void setOutPutTableStructure(boolean outPutTableStructure);
}
